package com.lemon.stock.local

import android.content.Context
import android.content.Intent
import android.widget.Toast
import androidx.compose.ui.res.stringResource
import com.lemon.stock.R
import com.lemon.stock.ui.*
import com.lemon.stock.util.Resource
import com.lemon.stock.util.showMessage

object MineFuncList {

    val functions: List<FuncItem> = listOf(
        FuncItem(icon = R.drawable.ic_menu_import, title=R.string.menu_import){
            it.startActivity(Intent(it, ImportActivity::class.java))
        },
        FuncItem(icon = R.drawable.ic_menu_download, title=R.string.menu_download, caption="将替换本地数据"){
            it.startActivity(Intent(it, DownloadActivity::class.java))
        },
        FuncItem(icon = R.drawable.ic_menu_upload, title=R.string.menu_upload){
            it.startActivity(Intent(it, UploadActivity::class.java))
        },
        FuncItem(icon = R.drawable.ic_menu_setup, title=R.string.menu_configure){
            it.startActivity(Intent(it, ConfigureActivity::class.java))
        },
        FuncItem(icon = R.drawable.ic_menu_msg, title=R.string.menu_configure){
            it.startActivity(Intent(it, FeedbackActivity::class.java))
        },
        FuncItem(icon = R.drawable.ic_menu_donate, title=R.string.menu_donate){
            //showMessage(it, "抖内最帅")
            it.startActivity(Intent(it, DonateActivity::class.java))
        },
        FuncItem(icon = R.drawable.ic_menu_about, title=R.string.menu_about, direct = "版本号：1.0.0"){
            it.startActivity(Intent(it, AboutActivity::class.java))
        }

    )
}

class FuncItem(
    var icon: Int = R.drawable.ic_menu_default,
    var title: Int = R.string.app_name,
    var caption: String = "",
    var direct: String = "",
    var onclick: (context: Context)->Unit
)